s1_goto_dir() {
    cd "$1" || return 1
}

s2_touch_empty_file_with_given_name() {
    touch "$1" || { echo "Failed to create file";return 1; }
	return 0
}

s3_make_directories() {
    mkdir -p projects/{git,backup}
}

s4_create_6_files() {
    touch projects/{linux1_{centos,redhat,c_programming},linux2_{centos,redhat,c_programming}}
}

s5_make_directories_in_git() {
    mkdir -p projects/git/{linux1,linux2}
    echo "已在git目录中创建了子目录:linux1,linux2"
}

s6_move_files_to_dir_1_or_2() {
    mv projects/linux1_* projects/git/linux1/
    mv projects/linux2_* projects/git/linux2/
    return $?
}

s7_create_package_and_compress() {
	mkdir -p projects/backup
    tar -czvf projects/backup/git.tar.gz -C projects git
}

s8_delete_dir_git() {
    rm -rf projects/git
}

s9_recover_from_git_tar_gz_backup() {
    tar -zxvf projects/backup/git.tar.gz -C projects
    return $?
}

s10_create_package_and_compress() {
	mkdir -p projects/backup
    tar -jcvf projects/backup/git.tar.bz2 -C projects git
}

s11_find_and_sort_alphabetically_all_created_files_and_dirs() {
	find . -path ./projects -o -path './projects/*' -type f -o -type d | sort
}

s12_get_next_15_minutes_boundary() {
    now=$(date +%s)
    future=$(( (now + 900) / 900 * 900))
    date -d @$future +%Y-%m-%d_%H:%M:00
}
